package me.sealer.packageinfo;

import me.sealer.packageinfo.annotation.MyPackageAnnotation;

import java.lang.annotation.Annotation;

/**
 * Created by sealer on 09-16-2017.
 */
public class TestPackageInfo {
    public static void main(String[] args) {

        //包内常量
        String s = MyConstant.HELLO_WORLD;
        String ss = YourConstant.HELLO_WORLD;

        //包内方法
        String sss = new MyMethod().methodInPackage();

        //包级注解
        Package pkg = Package.getPackage("com.sealer.packageinfo");
        for(Annotation annotation : pkg.getAnnotations()) {
            if (annotation instanceof MyPackageAnnotation) {
                System.out.println(annotation.annotationType().getName() + " : " + ((MyPackageAnnotation) annotation).value());
            }
        }

    }
}
